package com.dd.cloud.user.entity.role;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author zk
 */
@Data
@EqualsAndHashCode
@Accessors(chain = true)
@Table(comment = "管理员角色表")
public class AdminRole {

    /**
     * 角色id
     */
    @TableId(value = "id", type = IdType.AUTO)
    @Column(isKey = true, isAutoIncrement = true)
    private Integer id;

    /**
     * 角色名称
     */
    @Column(length = 20, comment = "角色名称", isNull = false)
    private String roleName;

    /**
     * 角色描述
     */
    @Column(length = 100, comment = "角色描述")
    private String roleDesc;

    /**
     * 默认超级管理员 1默认 2自定义
     */
    @Column(type = MySqlTypeConstant.TINYINT, comment = "默认超级管理员 1默认 其他自定义")
    private Integer admin;

    /**
     * 类型
     */
    @Column(type = MySqlTypeConstant.TINYINT, comment = "类型")
    private Integer type;

    /**
     * 状态 1正常 2禁用 -1删除
     */
    @Column(type = MySqlTypeConstant.TINYINT, comment = "1正常 2禁用 -1删除")
    private Integer status;

    /**
     * 创建时间
     */
    @Column(comment = "创建时间", defaultValue = "now()")
    private LocalDateTime createDate;

    /**
     * 菜单id列表
     */
    @TableField(exist = false)
    private List<Integer> menuIds;

    /**
     * 药房id
     */
    @Column(comment = "药房id")
    private Integer pharId;
}
